package demo1;

import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2023-04-08
 * Time: 19:04
 */
public class Main {
    public static void main(String[] args) {
       /* Person person1 = new Person("张三", 20);
        Person person2 = new Person("张三", 20);
        Person person3 = new Person("王五", 20);
//        Object o1 = person;
//        System.out.println( o1.getClass());
        Person[] persons ={person1, person2, person3};
        System.out.println(Arrays.toString(persons));
        Object
//        int a = 10;
//        int b = 20;
//        System.out.println( person1 );
//        System.out.println( person2);
        System.out.println(  person1.equals(person2)  );

//        System.out.println( person);
*/
        /*Person per1 = new Person("gaobo", 20) ;
        Person per2 = new Person("gaobo", 20) ;
        System.out.println(per1.hashCode());
        System.out.println(per2.hashCode());*/
        // Object接收数组对象，向上转型
        Object obj = new int[]{1,2,3,4,5,6} ;
        // 向下转型，需要强转
        int[] data = (int[]) obj ;
        for(int i :data){
            System.out.println(i+"、");
        }
    }
}
